package com.AI.AIDemo.Demos.Web.Service.ServiceImpl;

import com.AI.AIDemo.Demos.Web.Entity.ConvolutionalAndLinearLayerNeuralNetworksEntity;
import org.dromara.easyai.entity.ThreeChannelMatrix;
import org.dromara.easyai.i.OutBack;
import org.dromara.easyai.matrixTools.Matrix;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/*
 * @Author:大力王
 * @Date:2025/4/29-29-12:36
 * 开始了
 */
@Service
public class OutBackImpl implements OutBack {

    @Resource
    private ConvolutionalAndLinearLayerNeuralNetworksEntity convolutionalAndLinearLayerNeuralNetworksEntity;

    /**
     *这个方法是神经网络输出结果回调。
     *
     * @param out 回调值
     * @param id 为此次输出对应的输出神经元ID
     * @param eventId 输入神经元输入参数时，为保证线程安全所输入的线程安全ID
     */
    @Override
    public void getBack(float out, int id, long eventId) {
        if(!convolutionalAndLinearLayerNeuralNetworksEntity.isSoftMax()){
            out = 0.0025F;
            System.out.println("输出神经元："+id+"输出结果："+out);
        }
    }

    @Override
    public void getSoftMaxBack(long l, List<Float> list) {

    }

    @Override
    public void backWord(String s, long l) {

    }

    @Override
    public void getBackMatrix(Matrix matrix, int i, long l) {

    }

    @Override
    public void getWordVector(int i, float v) {

    }

    @Override
    public void getBackThreeChannelMatrix(ThreeChannelMatrix threeChannelMatrix) {

    }
}
